import { AICom } from "./AICom";

export abstract class AAIHandler {
    // 检查是否满足条件
    public abstract Check(aiCom: AICom): AICom;

    // 协程编写必须可以取消
    public abstract Execute(aiCom: AICom, cancellationToken: et.CancelToken): Promise<void>;
}
export function AIHandler(aiid: string) {
    return function <T extends AAIHandler>(target: new (...args: any[]) => T) {
        AIHandlers.Add({ id: aiid, ctor: target });
    }
}
export const AIHandlers = new Array<{ id: string, ctor: new (...args: any[]) => AAIHandler }>();